package com.ny.demo603;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DbUntil {
    private static final String URL = "jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true";
    private static final String DB_USER = "root";
    private static final String DB_PASSWORD = "123456";

    public Connection getConnection() throws ClassNotFoundException, SQLException, SQLException {
            Class.forName("com.mysql.jdbc.Driver");
            Connection conn= DriverManager.getConnection(URL, DB_USER, DB_PASSWORD);
            return conn;
    }
}
